<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
         *{
            margin: 0;
            padding: 0;
        }
        header{
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px ;
            background-color: rgb(24, 114, 170);
            color: white;
        }
        .container{
            display: flex;
        }
        .container aside{
            width: 100px;
            background-color: rgb(24, 114, 170);
            color: #eee;
            text-align: center;
            line-height: 40px;
        }
        .container aside div.active{
            background-color: #555;
            color: white;
        }
        .container main{
            flex:1;
            padding: 20px;
        }
        .container main .inputbox{
            margin: 20px 0;
        }
        .container main .inputbox input{
            height: 40px;
            border-radius: 5px;
            width: 300px;
            padding-left: 20px;
            outline: none;
            border: 1px solid #ccc;
        }
        .container main .inputbox button{
            background-color: rgb(44, 156, 44);
            border-radius: 5px;
            text-align: center;
            line-height: 40px;
            color: white;
            margin-left: 20px;
            padding: 0 30px;
            border: none;
        }
        .container main .add{
            background-color: rgb(44, 156, 44);
            border-radius: 5px;
            text-align: center;
            line-height: 40px;
            color: white;
            padding: 0 30px;
            border: none;
        }
        .container main table{
            margin: 20px 0;
            width: 100%;
            line-height: 40px;
            text-align: center;
        }
        .container main table tr th{
            max-width: 200px;
        }
        .container main table tr th:first-child, .container main table tr td:first-child{
            text-align: left;
        }
        .container main .foot{
            text-align: center;
            line-height: 40px;
            
        }
        .container main .foot span{
            border: 1px solid #ccc;
            padding: 0 30px;
            display: inline-block;
        }
    </style>
</head>
<body>
    <header>
        <span class="logo">9466云专题</span>
        <span>龙猫（9466云专题）</span>
    </header>
    <section class="container">
        <aside>
            <div>首页</div>
            <div>专题</div>
            <div class="active">用户</div>
            <div>设置</div>
            <div>日志</div>
        </aside>
        <main>
            <div class="inputbox">
                <input type="text" placeholder="搜索用户"><Button>搜索</Button>
            </div>
            <button class="add">+添加用户</button>
            <table>
                <thead>
                    <tr>
                        <th>邮箱（用户）</th>
                        <th>姓名</th>
                        <th>电话</th>
                        <th>所属组</th>
                        <th>管理员</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- <tr>
                        <td>15426554@qq.com</td>
                        <td>孙瑞</td>
                        <td>1245495565</td>
                        <td>编辑组</td>
                        <td>是</td>
                        <td><span class="statusok">正常</span></td>
                        <td><span>编辑</span><span>删除</span></td>
                    </tr>
                    <tr>
                        <td>15426554@qq.com</td>
                        <td>孙瑞</td>
                        <td>1245495565</td>
                        <td>编辑组</td>
                        <td>是</td>
                        <td><span class="statusok">正常</span></td>
                        <td><span>编辑</span><span>删除</span></td>
                    </tr>
                    <tr>
                        <td>15426554@qq.com</td>
                        <td>孙瑞</td>
                        <td>1245495565</td>
                        <td>编辑组</td>
                        <td>是</td>
                        <td><span class="statusok">正常</span></td>
                        <td><span>编辑</span><span>删除</span></td>
                    </tr> -->
                </tbody>
            </table>
            <div class="foot">
                <span>上一页</span>
                <span>下一页</span>
            </div>
        </main>
    </section>
    
</body>
<script src="./promise.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/Mock.js/1.0.0/mock.js"></script>
<script src="./mock.js"></script>
<script>
    function render(data){
        var str=data.map((item,index)=>{
            return `
            <tr>
                        <td>${item.email}</td>
                        <td>${item.name}</td>
                        <td>${item.phone}</td>
                        <td>${item.isgroup}</td>
                        <td>${item.isadmin?'是':'否'}</td>
                        <td><span class="statusok">${item.status?'正常':'异常'}</span></td>
                        <td><span>编辑</span><span>删除</span></td>
                    </tr>`
        }).join('')
        document.querySelector('tbody').innerHTML=str
    }
    render(data.list)
</script>
</html>